#!/usr/bin/python
# -*- coding: UTF-8 -*-


def test(__name__):
    print(__name__)
    return "Va"+__name__

print("a");
s = test("bbb")
print(s)


class Test:
       def __init__(self):
        self.foo = 11
        self._bar = 23
        self.__baz = 25
t = Test()
print(t.foo)
dir(t)
#print(t.__baz)


from collections import OrderedDict
import pandas as pd


examDict={'学习时间':[0.5,0.75,1.00,1.25,1.50,1.75,1.75,2.00,2.25,2.50,2.75,3.00,3.25,3.50,4.00,4.25,4.50,4.75,5.00,5.50],
          '分数':[10,22,13,43,20,22,33,50,62,48,55,75,62,73,81,76,64,82,90,93]
}
examOrderDict=OrderedDict(examDict)
examDf=pd.DataFrame(examOrderDict)

#提取特征features
exam_X=examDf.loc[:,'学习时间']
#提取标签label
exam_y=examDf.loc[:,'分数']


import matplotlib.pyplot as plt
plt.scatter(exam_X,exam_y,color="b",label="exam data")
#添加图标
plt.xlabel("Hours")
plt.ylabel("Score")
#显示图像
plt.show()


from sklearn.model_selection import train_test_split
X_train,X_test,y_train,y_test=train_test_split(exam_X,
                                              exam_y,
                                              train_size= .8)
#输出特征和标签
print('原始数据特征：',exam_X.shape,
     '训练集数据特征：',X_train.shape,
     '测试集数据特征：',X_test.shape)
print('原始数据标签：',exam_X.shape,
     '训练集数据标签：',y_train.shape,
     '测试集数据标签：',y_test.shape)
print(type(X_train))